<v-box title="博客备份">
    <v-tab ref="tab">
        <v-tab-pane label="资源文件备份">
            <v-table ajax_url="/admin/backup/table?type=resources"  ref="table1" :operations="operations"  ></v-table>
        </v-tab-pane>
        <v-tab-pane label="文章备份">
            <v-table ajax_url="/admin/backup/table?type=posts"  ref="table1" :operations="operations"  ></v-table>
        </v-tab-pane>
        <v-tab-pane label="数据库备份">
            <v-table ajax_url="/admin/backup/table?type=databases"  ref="table1" :operations="operations"  ></v-table>
        </v-tab-pane>

    </v-tab>
    <v-row>
        <v-col>
            <button id = "blogSubmit" type="button" class="btn btn-success"   @click="backUp"  >备份</button>
        </v-col>
    </v-row>



</v-box>
<script>
    new Vue({
        el:"#app" ,
        data : {
            type:"",
            ajax_url : '/admin/backup/table' ,
            operations : [
                {
                    name : '下载' ,
                    class: 'btn-primary',
                    icon:'edit',
                    method : function(row , $table) {
                        axios.get("/admin/backup/dowload").then(function (response) {
                            $.alert(response.data);
                        })
                    }
                } ,
                {
                    name : '发送到邮箱' ,
                    class: 'btn-success',
                    icon:'edit',
                    method : function(row , $table) {
                        axios.get("/admin/backup/email").then(function (response) {
                            $.alert(response.data);
                        })
                    }
                } ,
                {
                    name : '删除'  ,
                    class: 'btn-danger',
                    icon:'trash',
                    method : function(row ,$table) {
                        axios.get("/admin/backup/delete").then(function (response) {
                            $.alert(response.data);
                        })
                    }
                }
            ]
        } ,
        methods : {
            backUp: function(type) {
                debugger;
                axios.get("/admin/backup/table?type=" + type).then(function (response) {
                    $.alert(response.data);
                })
            }

        } ,
        mounted : function () {
            debugger
            // var self = this;
            // axios.get("/admin/index/data").then(function (response) {
            //     $.extend(self,response.data);
            // })

        }
    })

</script>
